import { Tank } from "../tank";
import { TankProps } from "../tankProps";
import { Image } from "leafer-ui";
export class AttackIntervalProp extends TankProps {
  constructor({ x, y }: { x: number; y: number }) {
    const recoveryProp = new Image({
      url: "/gongjiProp.png",
      width: 30,
      draggable: false,
      height: 30,
      x,
      y,
    });
    super({ x, y, targter: recoveryProp });
  }
  effect(tank: Tank): void {
    this.remove();
    tank.setAttackInterval(tank.getAttackInterval() / 2, 10);
  }
}
